package com.houg.testuserapi.service;

import com.houg.testuserapi.model.vo.OrderVo;
import com.houg.testuserapi.service.fallback.OrderServiceFallBackImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Author: NALHOUG
 * @Time: 2019/11/8 15:26
 * @Explain:
 */
@FeignClient(value = "test-order-api",fallback = OrderServiceFallBackImpl.class)
public interface GetOrderService {
    /**
     * 查看用户订单
     * @param userId 用户唯一标识
     * @return 订单信息
     */

    @GetMapping("/selectUserOrder/{userId}")
    OrderVo selectUserOrder(@PathVariable String userId);

    /**
     * 支付订单
     * @param orderId 用户唯一标识
     * @return 订单信息
     */
    @GetMapping("/getPay/{orderId}")
    String getPay(@PathVariable String orderId);

    /**
     * 取消订单
     * @param userId 用户唯一标识
     * @param orderId 订单编号
     * @return 订单信息
     */
    @GetMapping("/close/{userId}/{orderId}")
    String closeOrder(@PathVariable String userId,@PathVariable String orderId);
}
